home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / source_code / dhtmlunl / dhtml.exe / CD Content / Chap15 / dun15_12.txt < prev    next >
Encoding:
Text File  |  1997-12-18  |  2.4 KB  |  72 lines

  1. <HTML>
  2.  
  3. <HEAD>
  4.  
  5.   <TITLE>Exposing Style Sheets in IE4</TITLE>
  6.  
  7.  
  8.  
  9.   <LINK ID=linked REL=STYLESHEET TYPE="text/css" HREF="linkedStyle.css">
  10.  
  11.  
  12.  
  13.   <STYLE ID=defined TITLE="The Defined Style Sheet">
  14.  
  15.     @import url(importedStyle.css);
  16.  
  17.  
  18.  
  19.     H1               { color: darkBlue; margin: 0px; }
  20.  
  21.     .layer           { position: absolute; }
  22.  
  23.     #banner          { background-color: yellow; }
  24.  
  25.   </STYLE>
  26.  
  27. </HEAD>
  28.  
  29.  
  30.  
  31. <BODY>
  32.  
  33.   <BLOCKQUOTE>
  34.  
  35.  
  36.  
  37.   <P><IMG ID=arrow SRC="arrow.gif">
  38.  
  39.  
  40.  
  41.   <DIV ID=banner CLASS=layer STYLE="color: blue; left: 72; top: 15;">
  42.  
  43.     <H1>
  44.  
  45.       Exposing Style Sheets in IE4
  46.  
  47.     </H1>
  48.  
  49.   </DIV>
  50.  
  51.  
  52.  
  53.   <BR><BR>
  54.  
  55.   All imported, linked, and defined style sheets are exposed as
  56.  
  57.   styleSheet objects into the <TT>styleSheets</TT> array.  The
  58.  
  59.   following are the properties of each of the stylesheet objects:
  60.  
  61.  
  62.  
  63.   <BLOCKQUOTE><DL>
  64.  
  65.   <SCRIPT>
  66.  
  67.     document.writeln("<DT CLASS=first><B>LINK</B></DT>");
  68.  
  69.     document.writeln("<DD><B>id:</B> ");
  70.  
  71.     document.writeln(document.styleSheets.linked.id);
  72.  
  73.     document.writeln("</DD>");
  74.  
  75.     document.writeln("<DD><B>href:</B> ");
  76.  
  77.     document.writeln(document.styleSheets.linked.href);
  78.  
  79.     document.writeln("</DD>");
  80.  
  81.     document.writeln("<DD><B>readOnly:</B> ");
  82.  
  83.     document.writeln(document.styleSheets.linked.readOnly);
  84.  
  85.     document.writeln("</DD>");
  86.  
  87.  
  88.  
  89.     document.writeln("<DT><B>STYLE</B></DT>");
  90.  
  91.     document.writeln("<DD><B>title:</B> ");
  92.  
  93.     document.writeln(document.styleSheets.defined.title);
  94.  
  95.     document.writeln("</DD>");
  96.  
  97.     document.writeln("<DD><B>owningElement:</B> ");
  98.  
  99.     document.writeln(document.styleSheets.defined.owningElement.tagName);
  100.  
  101.     document.writeln("</DD>");
  102.  
  103.     document.writeln("<DD><B>readOnly:</B> ");
  104.  
  105.     document.writeln(document.styleSheets.defined.readOnly);
  106.  
  107.     document.writeln("</DD>");
  108.  
  109.  
  110.  
  111.     document.writeln("<DT><B>@import</B></DT>");
  112.  
  113.     document.writeln("<DD><B>href:</B> ");
  114.  
  115.     document.writeln(document.styleSheets.defined.imports[0].href);
  116.  
  117.     document.writeln("</DD>");
  118.  
  119.     document.writeln("<DD><B>parentStyleSheet:</B> ");
  120.  
  121.     document.writeln(document.styleSheets[1].imports[0].parentStyleSheet.id);
  122.  
  123.     document.writeln("</DD>");
  124.  
  125.     document.writeln("<DD><B>readOnly:</B> ");
  126.  
  127.     document.writeln(document.styleSheets.defined.imports[0].readOnly);
  128.  
  129.     document.writeln("</DD>");
  130.  
  131.   </SCRIPT>
  132.  
  133.   </DL></BLOCKQUOTE>
  134.  
  135.  
  136.  
  137.   </BLOCKQUOTE>
  138.  
  139. </BODY>
  140.  
  141. </HTML>
  142.  
  143.